from django.db import models
from django.core.files.storage import FileSystemStorage
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _

fs = FileSystemStorage(location = settings.BASE_DIR)
	
class user(models.Model):
	user = models.OneToOneField(User)
	id_twitter = models.CharField(max_length=100)
	username = models.CharField(max_length=40)
	access_token = models.CharField(max_length=100)
	access_secret = models.CharField(max_length=100)

class package(models.Model):
	id_sender = models.ForeignKey('miniupload.user', related_name='enviado')
	id_receiver = models.ForeignKey('miniupload.user', related_name='recibido')
	original_file = models.CharField(max_length=250)
	date = models.DateTimeField('Fecha de subida', auto_now=True)
	comment = models.TextField(_('Comentario'))
	package = models.FileField(_('Paquete'), upload_to='paquetes')
